#pragma once

#include<iostream>

using namespace std;

class Date
{
	friend ostream& operator<<(ostream& cout, Date& d);
	friend istream& operator>>(istream& cin, Date& d);
public:
	Date(int year = 0, int month = 0, int day = 0);

	Date(const Date& d)
	{
		_year = d._year;
		_month = d._month;
		_day = d._day;
	}

	void Print()
	{
		cout << _year << "-" << _month << "-" << _day << endl;
	}


	bool operator==(const Date& d);
	bool operator!=(const Date& d);

	bool operator>=(const Date& d);
	bool operator>(const Date& d);

	bool operator<=(const Date& d);
	bool operator<(const Date& d);

	static int GetMonthDay(int year, int month);

	Date& operator+=(const int day);
	Date operator+(const int day);

	Date& operator-=(const int day);
	Date operator-(const int day);

	Date operator++();
	Date operator++(int);

	Date operator--();
	Date operator--(int);

	int operator-(const Date& d);

private:
	int _year;
	int _month;
	int _day;
};

ostream& operator<<(ostream& cout, Date& d);
istream& operator>>(istream& cin, Date& d);
